<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel frontend\models\ShopOrderSearcher */
/* @var $dataProvider yii\data\ActiveDataProvider */

//$this->title = 'Shop Orders';
$this->title = frontend\models\ShopOrder::getCTableName() . '管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="shop-order-index">

    <!--<h1><?= Html::encode($this->title) ?></h1>-->
	<?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
		<?php // echo Html::a('添加' . $this->title, ['create'], ['class' => 'btn btn-success']) ?>
    </p>
	<?=
	GridView::widget([
		'dataProvider' => $dataProvider,
//        'filterModel' => $searchModel,
		'columns' => [
				['class' => 'yii\grid\SerialColumn'],
//            'orderId',
//            'userId',
//			'addressId',
			'amount',
//			'status',
			["attribute" => "status",
				'value' => function ($data) {
					if ($data->status == 0) {
						return "待支付";
					} else if ($data->status == 1) {
						return "已支付";
					} else {
						return "已完成";
					}
				},
			],
			// 'expressId',
			// 'expressno',
			'createtime',
//			'updatetime',
				['class' => 'yii\grid\ActionColumn',
				'template' => '{view}',],
		],
	]);
	?>
</div>
